<%-- 
    Document   : manageOrder
    Created on : Oct 1, 2013, 7:41:18 PM
    Author     : DH
--%>

<%@page import="utils.CommonConstants"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Order Page</title>
    </head>
    <body>
        <h1>Manage Order</h1>
        <form action="<%=CommonConstants.SERVLET_PROCESS_ORDER %>">
            <input type="radio" name="stt" value="<%=CommonConstants.STATUS_ORDER_WAITING%>" 
                   <c:if test="${STT == 'Waiting'}">
                       checked="checked"
                   </c:if>
                   /> <%=CommonConstants.STATUS_ORDER_WAITING%>
            <input type="radio" name="stt" value="<%=CommonConstants.STATUS_ORDER_APPROVED%>"
                   <c:if test="${STT == 'Approved'}">
                       checked
                   </c:if>
                   /> <%=CommonConstants.STATUS_ORDER_APPROVED%>
            <input type="radio" name="stt" value="<%=CommonConstants.STATUS_ORDER_REJECTED%>"
                   <c:if test="${STT == 'Rejected'}">
                       checked
                   </c:if>
                   /> <%=CommonConstants.STATUS_ORDER_REJECTED%>
            <input type="radio" name="stt" value="<%=CommonConstants.STATUS_ORDER_DONE%>"
                   <c:if test="${STT == 'Done'}">
                       checked
                   </c:if>
                   /> <%=CommonConstants.STATUS_ORDER_DONE%>
            <input type="radio" name="stt" value="<%=CommonConstants.STATUS_ORDER_ALL%>"
                   <c:if test="${STT == 'All'}">
                       checked
                   </c:if>
                   /> <%=CommonConstants.STATUS_ORDER_ALL%>
            <input type="submit" value="Show" name="action" />
        </form>

        Order List
        <c:if test="${not empty ORD}">
            <table border="1">
                <thead>
                    <tr>
                        <th>No.</th>
                        <th>Id</th>
                        <th>Create Date</th>
                        <th>Customer</th>
                        <th>Status</th>
                    </tr>
                </thead>
                <tbody>
                    <c:forEach var="ord" items="${ORD}" varStatus="counter">
                        <tr>
                            <td>${counter.count}</td>
                            <td>${ord.id}</td>
                            <td>${ord.createDate}</td>
                            <td>[${ord.room}] ${ord.customer}</td>
                            <td>${ord.status}</td>
                        </tr>
                    </c:forEach>
                </tbody>
            </table>

        </c:if>
    </body>
</html>
